
import jmath from "@/_js/math";

const weexFunction = weex.requireModule('WeexFunction');
export default {
  
  //获取配置数据
  getCopyData(copyConfig) {

    if (!copyConfig) return undefined;
    
    /************************************ 交易对*/
    var copyPair = copyConfig.tradePairs[0];

    /************************************ 参数设置*/
    var copyReserves = copyConfig.reserves;

    /************************************ 其他设置*/
    var stopProfit = copyConfig.stopProfit.length ? jmath.cheng(copyConfig.stopProfit, '100') : '';
    var stopLoss = copyConfig.stopLoss.length ? jmath.cheng(copyConfig.stopLoss, '-100') : '';

    var pauseTime = copyConfig.pauseTime;
    var stopTime = copyConfig.stopTime;

    var cancelOrder = copyConfig.cancelOrder;
    var isConvert = copyConfig.isConvert;
    
    var copySets = { 
      'isOpen':true, //true 显示
      'isEdit':true, //true 可编辑
      'stopProfit':stopProfit, //止盈率
      'stopLoss':stopLoss, //止损率

      'pauseTime':pauseTime, //暂停时间戳
      'timeStopStamp':stopTime, //终止时间戳
      
      'cancelOrder':cancelOrder, //true 撤销订单
      'isConvert':isConvert, //true 兑换币种
    }
   
   return {copyPair, copyReserves, copySets};
  }
}